﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Chaliy.DbPro.Generators.TextAuthoring.Configuration;

namespace Chaliy.DbPro.Generators.Tests.TextAuthoring.Confgiration
{
	[TestClass]
	public class SentanceConfigurationTests
	{
		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		public void TestMinLengthConfiguration()
		{
			SentanceConfiguration configuration = SentanceConfigurationTests.GetEtalonData();
			Assert.AreEqual(5, configuration.MinLength);
		}

		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		public void TestMaxLengthConfiguration()
		{
			SentanceConfiguration configuration = SentanceConfigurationTests.GetEtalonData();
			Assert.AreEqual(12, configuration.MaxLength);
		}

		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		public void TestSepratorsConfiguration()
		{
			SentanceConfiguration configuration = SentanceConfigurationTests.GetEtalonData();
			Assert.AreEqual(3, configuration.Separators.Count);
		}

		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		public void TestComasConfiguration()
		{
			SentanceConfiguration configuration = SentanceConfigurationTests.GetEtalonData();
			Assert.AreEqual(2, configuration.Comas.Count);
		}

		private static SentanceConfiguration GetEtalonData()
		{
			return DataUtlities.CreateEtalonData().Sentance;
		}
	}
}
